#include<stdio.h>

int main()
{
	int sign=6,mask=0;
	while(mask==0)
	{
		if(sign%5==1&&sign%6==5&&sign%7==4&&sign%11==10)
		{
			printf("%d",sign);
			mask=1;
		}
		sign++;
	}
	return 0;
}
